package com.ojoin.trade.t0loan_core.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ojoin.trade.common.web.jcaptcha.JCaptcha;

/**
 * 验证码验证
 * @author huanggc
 *
 */
@Controller
@RequestMapping("/jcaptcha-validate")
public class AjaxJCaptchaValidateController {

    @RequestMapping(method = RequestMethod.GET)
    @ResponseBody
    public Object jqueryValidationEngineValidate(
            HttpServletRequest request,
            @RequestParam(value = "jcaptchaCode", required = true) String jcaptchaCode) {
       boolean  ret=JCaptcha.hasCaptcha(request, jcaptchaCode.toLowerCase().trim());
       return String.valueOf(ret);
    }
}
